package org.lds.message.center.admin.business.channel.converter;

import org.lds.message.center.admin.business.channel.entity.Channel;
import org.lds.message.center.admin.business.channel.model.request.ChannelBaseGetByKeyRequest;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

@Component
public class ChannelBaseGetByKeyRequestToEntityConverter implements Converter<ChannelBaseGetByKeyRequest, Channel> {

    @Override
    public Channel convert(ChannelBaseGetByKeyRequest source) {
        return Channel.builder()
                .name(source.getName())
                .desc(source.getDesc())
                .enable(source.getEnable())
                .build();
    }

}